import 'package:base_flutter/base_flutter.dart';
import 'package:flutter/material.dart';
import 'package:flutter/src/widgets/framework.dart';
import 'package:ls_work/viewmodel/service_order/department_list_view_model.dart';

class DepartmentListPage extends BaseStatefulMvvmWidget{
  @override
  State<StatefulWidget> createState() => _DepartmentListState();

}

class _DepartmentListState extends BaseMvvmListState<DepartmentListViewModel,DepartmentListPage>{
  @override
  Widget buildRootView(BuildContext context, Widget loadingContentWidget) {
    return Scaffold(
      appBar: AppBar(title: Text('选择部门'),),
      body: loadingContentWidget,
    );
  }

  @override
  Widget createItemWidget(int index) {
    var item = viewModel.listItems[index];
    return IconTitleTextWidget(item.officeName??"").onTap(() {
      finish(result: item);
    });
  }

  @override
  DepartmentListViewModel createViewModel() {
    return DepartmentListViewModel(context);
  }

}